package com.easondongh.common.enums;

import lombok.Getter;

/**
 * 返回前端状态枚举
 * @author EasonDongH
 * @date 2020/4/28 16:25
 */
@Getter
public enum ResponseEnum {
    SUCCESS(200, "操作成功"),
    LOGIN_SUCCESS(200, "登录成功"),
    QUERY_SUCCESS(200,"查询成功"),
    QUERY_FAIL(400,"查询失败"),
    ADD_SUCCESS(200,"添加成功"),
    ADD_FAIL(400,"添加失败"),
    DELETE_SUCCESS(200,"删除成功"),
    DELETE_FAIL(400,"添加失败"),
    UPDATE_SUCCESS(200,"修改成功"),
    UPDATE_FAIL(400,"修改失败"),
    INVALID_USERNAME_OR_PASSWORD(400, "用户名或密码错误"),
    CAN_NOT_DELETE_SUPER_ADMIN(400, "无法删除超级管理员"),
    UPLOAD_SUCCESS(200, "上传成功"),
    GOODS_BACK_SUCCESS(200, "退货成功"),
    GOODS_BACK_FAIL(400, "退货失败"),
    GOODS_BACK_NUMER_INVALID(400, "退货失败，退货数量不能大于进货数量"),
    GOODS_NOT_ENOUGH(400, "销售失败，库存不足"),
    UNAUTHORIZED(403,"未授权"),
    INVALID_CAPTCHA(400, "无效的验证码"),
    CAPTCHA_EXPIRED(419, "验证码已过期"),
    CAPTCHA_ERROR(400, "验证码不正确")
    ;
    private Integer code;
    private String msg;
    private ResponseEnum(){}
    private ResponseEnum(Integer code,String msg) {
        this.code = code;
        this.msg = msg;
    }
}
